﻿using UnityEngine;
using System.Collections.Generic;
using NCmd;

/// <summary>
/// 游戏驱动
/// </summary>
public class GameEngine : MonoBehaviour
{
    // Use this for initialization
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        //FightUIMgr.instance.Loop();
        TimerMgr.instance.Loop();
    }

    void OnDrawGizmos()
    {
#if UNITY_EDITOR
        GizmosMgr.instance.Loop();
#endif
    }

    /// <summary>
    /// 这里处理游戏退出
    /// </summary>
    void OnDestroy()
    {
        if (Net.instance.Connected)
        {
            Net.instance.SendCmd(new Logout());
        }
    }
}